package com.lmx.persistence.service;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.google.common.collect.Maps;
import com.lmx.persistence.service.common.BaseCrudServiceImpl;
import com.lmx.repoDomain.tmodel.CustomerVipInfo;
import com.lmx.repoDomain.tmodel.Dicttype;

/**
 * 会员信息Service实现
 *
 * @author ytche
 * @date 2017年7月13日
 *
 */
@Service(value = "customerVipInfoService")
public class CustomerVipInfoServiceImpl extends
		BaseCrudServiceImpl<CustomerVipInfo> implements CustomerVipInfoService {

	@Override
	public Boolean checkVipLevelDelete(Dicttype vipLevel) {
		Map<String, Object> param = Maps.newHashMap();
		param.put("delStatus", 0);
		param.put("level.id", vipLevel.getId());
		param.put("customer.delStatus", 0);
		List<CustomerVipInfo> customerVipInfos = super.find(param);
		return customerVipInfos == null || customerVipInfos.size() < 1;
	}
}
